package com.sohu.sip.auth.statistics.po;

import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/** @author Hibernate CodeGenerator */
public class RequestCount implements Serializable {

    /** identifier field */
    private String serverName;

    /** identifier field */
    private long requestCount;

    /** identifier field */
    private java.util.Date day;

    /** identifier field */
    private int hour;

    /** full constructor */
    public RequestCount(java.lang.String serverName, long requestCount, java.util.Date day, int hour) {
        this.serverName = serverName;
        this.requestCount = requestCount;
        this.day = day;
        this.hour = hour;
    }

    /** default constructor */
    public RequestCount() {
    }

    public java.lang.String getServerName() {
        return this.serverName;
    }

    public void setServerName(java.lang.String serverName) {
        this.serverName = serverName;
    }

    public long getRequestCount() {
        return this.requestCount;
    }

    public void setRequestCount(long requestCount) {
        this.requestCount = requestCount;
    }

    public java.util.Date getDay() {
        return this.day;
    }

    public void setDay(java.util.Date day) {
        this.day = day;
    }

    public int getHour() {
        return this.hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("serverName", getServerName())
            .append("requestCount", getRequestCount())
            .append("day", getDay())
            .append("hour", getHour())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof RequestCount) ) return false;
        RequestCount castOther = (RequestCount) other;
        return new EqualsBuilder()
            .append(this.getServerName(), castOther.getServerName())
            .append(this.getRequestCount(), castOther.getRequestCount())
            .append(this.getDay(), castOther.getDay())
            .append(this.getHour(), castOther.getHour())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getServerName())
            .append(getRequestCount())
            .append(getDay())
            .append(getHour())
            .toHashCode();
    }

}
